Field of the Invention
The present invention relates to a communication device, a method for controlling the communication device, and a program.
Description of the Related Art
In recent years, there have been a growing number of cases where electronic devices, such as digital cameras and printers, are equipped with a wireless local area network (LAN) station function and used as communication devices on a wireless LAN. For example, Japanese Patent Laid-Open No. 2011-35768 discloses an image sharing technique which involves using a digital camera equipped with a wireless LAN function.
The Wi-Fi Alliance established a standard called Wi-Fi Direct (registered trademark). The Wi-Fi Direct defines a protocol that determines whether each communication device operates as a wireless LAN access point or a wireless LAN station. Executing the protocol automatically determines which communication device serves as a wireless LAN access point and which communication device serves as a wireless LAN station.
The Wi-Fi Direct also defines a device discovery which is a protocol for searching for a partner device to be connected. The device discovery searches for a partner device by repeating search mode and wait mode in a random cycle. Each communication device transmits a search signal to search for a partner device in search mode (referred to as Search State in Wi-Fi Direct), and waits (or listens) for a search and responds to the search from the partner device in wait mode (referred to as Listen State in Wi-Fi Direct).
The Wi-Fi Direct also defines, as an optional function, a service discovery function which is the function of advertising and searching for information about services supported by an upper-level application. With the service discovery function, information about the function of a partner device can be obtained before execution of a connection process.